package com.zking.config;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by OWen on 2023-2023/12/7, project: springboot1206.
 * <p>
 * Author: OWen
 * Create Date: 2023/12/7
 * Project: com.zking.config in project: springboot1206
 * <p>
 * Notice: If you are using this class or file, check it and do some modification.
 */
@WebFilter("/*") // 拦截所有
public class MyFilter extends HttpFilter {
    @Override
    protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
        /* try {
            chain.doFilter(request, response);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ServletException e) {
            throw new RuntimeException(e);
        } catch (MyException e) {
            response.sendRedirect("/error/500");
        } */
    }
}
